package cn.dust.design.pattern.creational.builder.v2;

/**
 * @Author: dust
 * @Date: 2019/11/25 17:27
 */
public class Hero {

    private String heroName;
    private String heroQ;
    private String heroW;
    private String heroE;
    private String heroR;

    public Hero(HeroBuilder heroBuilder){
        this.heroName=heroBuilder.heroName;
        this.heroQ=heroBuilder.heroQ;
        this.heroW=heroBuilder.heroW;
        this.heroE=heroBuilder.heroE;
        this.heroR=heroBuilder.heroR;
    }

    @Override
    public String toString() {
        return "Hero{" +
                "heroName='" + heroName + '\'' +
                ", heroQ='" + heroQ + '\'' +
                ", heroW='" + heroW + '\'' +
                ", heroE='" + heroE + '\'' +
                ", heroR='" + heroR + '\'' +
                '}';
    }

    public static class HeroBuilder{
        private String heroName;
        private String heroQ;
        private String heroW;
        private String heroE;
        private String heroR;

        public HeroBuilder buildHeroName(String heroName){
            this.heroName=heroName;
            return this;
        }


        public HeroBuilder buildHeroQ(String heroQ) {
            this.heroQ=heroQ;
            return this;
        }

        public HeroBuilder buildHeroW(String heroW) {
            this.heroW=heroW;
            return this;
        }

        public HeroBuilder buildHeroE(String heroE) {
           this.heroE=heroE;
           return this;
        }

        public HeroBuilder buildHeroR(String heroR) {
           this.heroR=heroR;
           return this;
        }

        public Hero build(){

            return new Hero(this);
        }

    }
}
